#include<bits/stdc++.h>
// #define ll long long
// #define int long long
using namespace std;
char buf[1<<23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
    while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
    return x*f;
}
inline void write(int x)
{
    if(!x)
        putchar('0');
    char F[200];
    int tmp=x>0?x:-x;
    if(x<0)
        putchar('-');
    int cnt=0;
    while(tmp>0)
        F[cnt++]=tmp%10+'0',tmp/=10;
    while(cnt>0)
        putchar(F[--cnt]);
}
struct node
{
	int a,b;
};
const int N=505;
node a[N];
int sum[N][N];
double dp[N][N];
bool cmpa(node a,node b)
{
	return a.a<b.a;
}
bool cmpb(node a,node b)
{
	if(a.b!=b.b)
		return a.b<b.b;
	return a.a<b.a;
}
signed main()
{
    freopen("talk.in","r",stdin);
    freopen("talk.out","w",stdout);
	int n,k;
    double ans=1e18;
	cin>>n;
    cin>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].a>>a[i].b;
		if(a[i].b==-1)
			a[i].b=0x3f3f3f3f;
	}
	sort(a+1,a+n+1,cmpb);
	for(int i=n;i>=1;i--)
	{
		sort(a+i,a+n+1,cmpa);
		for(int j=1;j<=n-i+1;j++)
			sum[i][j]=sum[i][j-1]+a[i+j-1].a;
	}
	sort(a+1,a+n+1,cmpb);
	for(int cntb=0;cntb<=k;cntb++)
	{
		memset(dp,0x7f,sizeof(dp));
		dp[0][0]=0;
		for(int i=1;i<=n;i++)
			for(int j=0;j<=min(i,cntb);j++)
			{
				dp[i][j]=dp[i-1][j]+(double)a[i].a/(cntb+1);
				if(j&&a[i].b<=1000)
					dp[i][j]=min(dp[i][j],dp[i-1][j-1]+(double)a[i].b/j);
			}
		for(int i=cntb;i<=k;i++)
			ans=min(ans,dp[i][cntb]+(double)sum[i+1][k-i]/(cntb+1));
	}
	printf("%.15lf\n",ans);
	return 0;
}